<?php
namespace Mouta\AmistateBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Mouta\AmistateBundle\Entity
 *
 * @ORM\Table(name="social_network")
 * @ORM\Entity(repositoryClass="Mouta\AmistateBundle\Entity\SocialNetworkRepository")
 */
class SocialNetwork
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    protected $id;

    /**
     * @ORM\Column(type="integer")
     */
    protected $tipo;

    /**
     * @ORM\Column(type="string")
     */
    protected $token;

    /**
     * @ORM\Column(type="string")
     */
    protected $secret;

    /**
     * @ORM\Column(type="string")
     */
    protected $url;

    /**
     * @ORM\Column(type="string")
     */
    protected $external_id;

    /**
     * @ORM\Column(type="array")
     */
    protected $last_posts;

    /**
     * @ORM\Column(name="updated", type="datetime")
     * @Gedmo\Timestampable(on="update")
     */
    private $updated;

    /**
     * @ORM\ManyToOne(targetEntity="Usuario", inversedBy="social_network")
     * @ORM\JoinColumn(name="usuario_id", referencedColumnName="id", onDelete="Cascade")
     */
    protected $usuario;


    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set tipo
     *
     * @param integer $tipo
     *
     * @return SocialNetwork
     */
    public function setTipo($tipo)
    {
        $this->tipo = $tipo;

        return $this;
    }

    /**
     * Get tipo
     *
     * @return integer
     */
    public function getTipo()
    {
        return $this->tipo;
    }

    /**
     * Set token
     *
     * @param string $token
     *
     * @return SocialNetwork
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     * Set secret
     *
     * @param string $secret
     *
     * @return SocialNetwork
     */
    public function setSecret($secret)
    {
        $this->secret = $secret;

        return $this;
    }

    /**
     * Get secret
     *
     * @return string
     */
    public function getSecret()
    {
        return $this->secret;
    }

    /**
     * Set url
     *
     * @param string $url
     *
     * @return SocialNetwork
     */
    public function setUrl($url)
    {
        $this->url = $url;

        return $this;
    }

    /**
     * Get url
     *
     * @return string
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Set usuario
     *
     * @param \Mouta\AmistateBundle\Entity\Usuario $usuario
     *
     * @return SocialNetwork
     */
    public function setUsuario(\Mouta\AmistateBundle\Entity\Usuario $usuario = null)
    {
        $this->usuario = $usuario;

        return $this;
    }

    /**
     * Get usuario
     *
     * @return \Mouta\AmistateBundle\Entity\Usuario
     */
    public function getUsuario()
    {
        return $this->usuario;
    }

    /**
     * Set external_id
     *
     * @param string $externalId
     *
     * @return SocialNetwork
     */
    public function setExternalId($externalId)
    {
        $this->external_id = $externalId;

        return $this;
    }

    /**
     * Get external_id
     *
     * @return string 
     */
    public function getExternalId()
    {
        return $this->external_id;
    }


    /**
     * Set last_posts
     *
     * @param array $lastPosts
     *
     * @return SocialNetwork
     */
    public function setLastPosts($lastPosts)
    {
        $this->last_posts = $lastPosts;

        return $this;
    }

    /**
     * Get last_posts
     *
     * @return array 
     */
    public function getLastPosts()
    {
        return $this->last_posts;
    }

    /**
     * Set updated
     *
     * @param \DateTime $updated
     *
     * @return SocialNetwork
     */
    public function setUpdated($updated)
    {
        $this->updated = $updated;

        return $this;
    }

    /**
     * Get updated
     *
     * @return \DateTime 
     */
    public function getUpdated()
    {
        return $this->updated;
    }
}
